@extends('layouts.admin')
@push('morecss')
    <link href="/vendor/AdminInspinia/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
@endpush

@push('morescript')
    <script type="application/javascript">
        let page_params = {
            @can('admin.wxcardmemberlist.index')
            url_list: '{{ route('admin.wxcardmemberlist.index') }}',
            @endcan
            data_member_card:@json($memberCardList),
            data_member_level_group:@json($memberLevelGroupList),
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/wxcardmemberlist_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="control-label" for="keyword">关键字</label>
                        <input type="text" id="keyword" name="keyword" v-model="searchParams.keyword"
                               placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">会员卡列表</label>
                        <select class="form-control" name="card_base_id" id="card_base_id"
                                v-model="searchParams.card_base_id">
                            <option value="0">请选择</option>
                            <option v-for="item in member_card" v-bind:value="item.card_base_id">@{{ item.title }}</option>
                        </select>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">会员卡等级列表</label>
                        <select class="form-control" name="card_base_id" id="card_base_id"
                                v-model="searchParams.level_id">
                            <option value="0">请选择</option>
                            <option v-for="item in member_level" v-bind:value="item.id">@{{ item.name }}</option>
                        </select>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" v-on:click="query"><i
                                        class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-sm-5" style="width: 300px;">
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--卡券库存设置-->
    <div class="ibox-content" id="box-detail" style="display: none">
        <div class="row m-b-lg m-t-lg">
            <div class="col-md-10 col-sm-offset-2" v-if="curMemberListData">
                <div class="profile-image">
                    <img :src="curMemberListData.user.headimgurl" class="img-circle circle-border m-b-md" alt="profile">
                </div>
                <div class="profile-info">
                    <div class="">
                        <div>
                            <h2 class="no-margins">
                                @{{ curMemberListData.nickname }}
                            </h2>
                            <div>
                                <b>会员卡状态：</b>
                                <span class="label">@{{ curMemberListData.user_card_status_str }}</span>
                            </div>
                            <div>
                                <b>是否被激活：</b>
                                <span v-if="curMemberListData.has_active" class="label label-info">已激活</span>
                                <span v-else class="label label-warning">未激活</span>
                            </div>
                            <div>
                                <b>领卡时间：</b>
                                @{{ curMemberListData.updated_at }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-12" v-if="curMemberListData">
                <table class="table small m-b-xs">
                    <thead>
                    <tr>
                        <th>积分</th>
                        <th>会员等级</th>
                        <th>储蓄值</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>@{{ curMemberListData.bonus }}</td>
                            <td>@{{ curMemberListData.level_name }}</td>
                            <td>@{{ curMemberListData.balance }}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="col-md-12" v-if="curMemberListData">
            <table class="table small m-b-xs">
                <tbody>
                <tr>
                    <td>
                        <b>卡券ID：</b>@{{ curMemberListData.card_id }}
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>卡券Code码：</b>@{{ curMemberListData.user_card_code }}
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>openId：</b>@{{ curMemberListData.openid}}
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>unionId：</b>@{{ curMemberListData.user.unionid}}
                    </td>
                </tr>
                <tr v-for="item in curMemberListData.user_info.field_list">
                    <td>
                        <strong>@{{ item.name }}：</strong> @{{ item.value }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-4">
                <button class="btn btn-primary btn-sub" type="button" v-on:click="close">关闭</button>
            </div>
        </div>
    </div>
@endsection